<!DOCTYPE html>
<html>
  <head>
    <title>bind.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
	<script type="text/javascript" src="../javascript/lib/jquery-1.9.1/jquery-1.9.1.min.js"></script>
	<script type="text/javascript">
		$(function(){
			/*bind()方法可以在同一事件上绑定多个事件处理程序*/
			$("#adiv").bind("click" , function(){
				alert("handler1");
			});
			$("#adiv").bind('click' , function(){
				alert("handler2");
			});
			
			/*preventDefault方法的使用：阻止*/
			$("a").click(function(event){
				event.preventDefault();
				alert(event.type);
				$('<div/>').append("default prevent!").appendTo("#log");
			})
		})
	</script>
  </head>
  
  <body>
  	<div id="adiv" class="boxdiv">Press Me </div>
  	
  	<a href="www.baidu.com">event prevent default</a>
  	<div id="log"></div>
  </body>
</html>
